import {
  get,
  put,
  _delete,
  post
} from '@/lin/plugin/axios'
class Advertising{
  static async getByState(state, page, count) {
    const res = await get(`recruit/info/page/${state}`, {
      page: page,
      count: count
    })
    return res
  }

  static async advPics() {
    const res = await get(`recruit/advertising/advPics`)
    // const res = ["https://cdn6.haitou.cc/homepage/1679043364.jpg?x-oss-process=image/resize,m_fixed,w_695,h_378",
    //   "http://cdn6.haitou.cc/homepage/1647588427.jpg",
    //   "http://cdn6.haitou.cc/homepage/1647940128.jpg",
    //   "http://cdn6.haitou.cc/homepage/1647940128.jpg",
    //   "http://cdn6.haitou.cc/homepage/1647940128.jpg",
    //   "https://cdn6.haitou.cc/homepage/1679043598.jpg?x-oss-process=image/resize,m_fixed,w_695,h_378"];
    return res
  }

  static async getById(id) {
    const res = await get(`recruit/advertising/get/${id}`)
    return res
  }

  static async delete(id) {
    const res = await _delete(`recruit/advertising/${id}`)
    return res
  }

  static async update(id, data) {
    const res = await put(`recruit/advertising/${id}`, data)
    return res
  }

  static async create(data) {
    const res = await post(`recruit/advertising`, data)
    return res
  }
  static async pages(state) {
    const res = await get(`recruit/advertising/page`)
    return res
  }
}

export {
  Advertising
}
